package me.zhengjie.modules.inspection.service;

import me.zhengjie.modules.inspection.domain.InspectionTemplateItemRel;
import me.zhengjie.modules.inspection.service.dto.InspectionTemplateItemRelDTO;
import me.zhengjie.modules.inspection.service.dto.InspectionTemplateItemRelQueryCriteria;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
* @author xuyukun
* @date 2019-07-07
*/
// @CacheConfig(cacheNames = "inspectionTemplateItemRel")
public interface InspectionTemplateItemRelService {

    /**
    * queryAll 分页
    * @param criteria
    * @param pageable
    * @return
    */
    // @Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(InspectionTemplateItemRelQueryCriteria criteria, Pageable pageable);

    /**
    * queryAll 不分页
    * @param criteria
    * @return
    */
    // @Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(InspectionTemplateItemRelQueryCriteria criteria);

    /**
     * findById
     * @param id
     * @return
     */
    // @Cacheable(key = "#p0")
    InspectionTemplateItemRelDTO findById(Long id);

    List<InspectionTemplateItemRel> findByTemplateId(Long id);
    /**
     * create
     * @param resources
     * @return
     */
    // @CacheEvict(allEntries = true)
    InspectionTemplateItemRelDTO create(InspectionTemplateItemRel resources);

    /**
     * update
     * @param resources
     */
    // @CacheEvict(allEntries = true)
    void update(InspectionTemplateItemRel resources);

    /**
     * delete
     * @param id
     */
    // @CacheEvict(allEntries = true)
    void delete(Long id);
}